VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "LGuia"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Dim dao As New DAOGuia
Public Function getLista(bparm As bguia) As Collection
Set dao.Connection = utilConexion
Set getLista = dao.getLista(bparm)
End Function
'---------------------------------------------------------------------------------------
' Procedure : guardar
' DateTime  : 20/04/2008 14:12
' Author    :
' Purpose   : Guardar Cabecera del Pedido
'---------------------------------------------------------------------------------------
'
Public Function guardar(bean As bguia) As Integer
Dim result As Integer
Dim bdetalle As BGuiaDetalle
Set dao.Connection = utilConexion
If bean.nCodigo = 0 Then
    result = dao.insertar(bean)
Else
    result = dao.actualizar(bean)
End If
dao.guardaDetalle bean
guardar = result
End Function
Public Function guardarDetalle(ByRef bean As bguia) As Integer
    Set dao.Connection = utilConexion
    guardarDetalle = dao.guardaDetalle(bean)
    If guardarDetalle = UtilConstantes.OPT_DATOS_GUARDADOS Then
        guardarDetalle = dao.actualizar(bean)
        Set bean = dao.getGuiaInfo(bean)
    End If
End Function
Public Function EliminaDetalle(ByRef bean As bguia) As Integer
'    Set dao.Connection = utilConexion
'    Dim result As Integer
'    EliminaDetalle = dao.eliminarDetalle(bean)
'    result = UtilConstantes.OPT_DATOS_ELIMINADOS
End Function
Public Function getDetalle(ByRef bean As bguia) As Integer
Set dao.Connection = utilConexion
dao.getListaDetalle bean
End Function

Public Function procesar(bean As bguia) As Integer
Set dao.Connection = utilConexion
procesar = dao.procesar(bean)
End Function


Public Function getInfo(bean As bguia) As bguia
Dim b As bguia
Set dao.Connection = utilConexion
Set b = dao.getInfo(bean)
dao.getListaDetalle b
Set getInfo = b
End Function
